README for the MASM 6.0 Demonstration Program ASMCLOCK.ASM ASMCLOCK is a direct translation of the sample program DIGCLOCK in Chapter 5 of Charles Petzold's "Programming Windows". The purpose of this demonstration program was not to show how much better assembler programming is than C for this particular application, rather to show that Windows programming is now POSSIBLE with MASM 6.0. Because of the new high-level and not-so high-level features in MASM 6.0, this sample application was actually a very straight-forward to develop. Files in this demonstration are: o README.TXT This file o ASMCLOCK.ASM Application source code o ASMCLOCK.MAK NMAKE file for this application o ASMCLOCK.DEF Linker DEF file o ASMCLOCK.OBJ Result of assembling ASMCLOCK.ASM o ASMCLOCK.EXE Application executable o WINDOWS.INC Converted WINDOWS.H o STDIO.INC Converted from STDIO.H by H2INC o TIME.INC Converted from TIME.H by H2INC o PROLOGUE.INC Prologue/Epilogue sequences NOTE: In order to actually build this application you must have the Windows SDK v3.0 and MASM 6.0. Items of Interest ----------------- If you build the application, the first interesting item you will notice is the new command-line program to run the assembler. Previous releases used MASM.EXE. Keeping with the rest of the Microsoft family of languages, this new release uses ML.EXE (akin to CL and FL). For those of you who have MAKE files that are dependent upon MASM.EXE, we have included a MASM.EXE utility that converts the old command-line arguments to the new and then invokes ML.EXE. ASMCLOCK.ASM demonstrates many of the new features available with MASM 6.0. Moving from the top of the files ASMCLOCK.ASM and moving down through the source, some of the items of interest are: o STDIO.INC and TIME.INC were directly converted from their C counterparts (STDIO.H and TIME.H) using the new utility in MASM 6.0, H2INC. H2INC converts the C header files to their MASM include file equivalent. H2INC takes advantage of the new features available in MASM 6.0, so the resulting .INC file can only be used with MASM 6.0. o PROTOTYPES. Prototypes are new to MASM 6.0. The have the same purpose as prototypes in other high-level languages. Having prototypes allows MASM to check on the calling convention, distance, number and types of arguments being used in PROC's and in INVOKE's (more on that in a bit). o New data initializers. Instead of DB's and DW's we now have BYTE (unsigned), SBYTE (signed), WORD, SWORD, REAL4, REAL8, etc. etc. o In the PROC statement for WinMain, the type of the hInstance parameter is HANDLE. MASM 6.0 has the new directive TYPEDEF to let programmer's define their own types (HANDLE and LPSTR are defined in WINDOWS.INC). o .IF (hPrevInstance == 0). MASM 6.0 has provided high-level programming constructs. The whole family includes .IF/.ELSEIF/.ELSE/.ENDIF, .WHILE/.ENDW, .REPEAT/.UNTIL/.UNTILCXZ, and .BREAK and .CONTINUE. o INVOKE. The counterpart to PROTO is INVOKE. This is an intelligent CALL. The arguments are pushed on to the stack according to the procedure's calling convention (and cleaned up if necessary). Programming for Windows is API function call based, so calling pre-set system functions is a large percentage of Windows programming, this feature alone makes Windows programming possible. These are some of the "cooler" new features in MASM 6.0, there are also some other less visible changes that make MASM 6.0 an even more powerful assembler. An example of this is the ability to ASSUME registers to items other than segments in this example BX gets ASSUME'd to a pointer to a structure. MASM 6.0 made this Windows demonstration possible. The high-level features in the assembler make the code easier to write and understand. Basically, MASM 6.0 makes it easier to make your programmer's faster. Thanks, B. ----------------end-of-author's-documentation--------------- Software Library Information: This disk copy provided as a service of Public (software) Library We are not the authors of this program, nor are we associated with the author in any way other than as a distributor of the program in accordance with the author's terms of distribution. Please direct shareware payments and specific questions about this program to the author of the program, whose name appears elsewhere in this documentation. If you have trouble getting in touch with the author, we will do whatever we can to help you with your questions. All programs have been tested and do run. To report problems, please use the form that is in the file PROBLEM.DOC on many of our disks or in other written for- mat with screen printouts, if possible. PsL cannot debug pro- programs over the telephone, though we can answer questions. Disks in the PsL are updated monthly, so if you did not get this disk directly from the PsL, you should be aware that the files in this set may no longer be the current versions. Also, if you got this disk from another vendor and are having prob- lems, be aware that some files may have become corrupted or lost by that vendor. Get a current, working disk from PsL. For a copy of the latest monthly software library newsletter and a list of the 3,000+ disks in the library, call or write Public (software) Library P.O.Box 35705 - F Houston, TX 77235-5705 Orders only: 1-800-2424-PSL MC/Visa/AmEx/Discover Outside of U.S. or in Texas or for general information, Call 1-713-524-6394 PsL also has an outstanding catalog for the Macintosh.